package com.qf.controller;

import com.qf.pojo.TbGood;
import com.qf.service.BrandService;
import com.qf.service.GoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class InfoController {
    @Autowired
    private GoodService goodService;
    @Autowired
    private BrandService brandService;

    @RequestMapping("info/{goodId}")
    public String info(@PathVariable("goodId") String goodId, Model model){
        //根据id查询商品详情
        TbGood good = goodService.selectGoodById(goodId);
        model.addAttribute("good",good);
        return "info";
    }
}
